package Twice.day10;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.text.ParseException;
import java.text.SimpleDateFormat;

/**
 * @Author: lya
 * @Description: 本类的作用描述:
 * @CreateDate: 2019/8/14
 * @Version: 1.0
 */
public class ExceptionDemo01 {
    public static void main(String[] args) {
       test01();
    }
    public static void test01(){
        //模拟一个非运行时异常
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        try {
            sdf.parse("2010/09/09");
            InputStream in = new FileInputStream("d:/success.txt");
        } catch (ParseException e) {
            //e.printStackTrace();
            System.out.println("解析失败");
        } catch (FileNotFoundException e) {
            e.printStackTrace();
            System.out.println("文件路径");
        }
        System.out.println("执行结束....");
    }
    /**
     * 注意点:当存在多个catch块的时候,如果异常类型存在父子关系的话,那么父类

     异常一定要放在子类异常的下方.
     */
    public static void test02(){

    }
}
